<template>
    <div class="activity-index">
    	<!-- <el-form :inline="true" >
          <el-form-item label="分类名">
            <el-input  placeholder="请输入分类名" ></el-input>
          </el-form-item>

          <el-form-item label="分类状态">
            <el-select  placeholder="请输选择分类状态">
              <el-option label="正常" value="noraml"></el-option>
              <el-option label="已删除" value="del"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <div class="query">
              <el-button type="primary" @click="onSubmit">查询</el-button>
        </div> -->
        <el-table :data="categorys" style="width: 100%">
            <el-table-column label="#" 
                             type="index"
                            :index="1">
            </el-table-column>
            
            <el-table-column label="分类名" prop="name" width="200">
              <template slot-scope="scope" align="center">
                <div class="info">
                  <img :src="scope.row.img" class="img">
                  <div>{{scope.row.name}}</div>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="创建时间" prop="createDate">
            </el-table-column>
            <el-table-column label="状态" prop="status">
            </el-table-column>
            <el-table-column label="操作" prop="desc" width="150">
                <template slot-scope="scope">
                    <el-button
                      size="mini"
                      type="primary"
                      @click="inNotice(scope.$index, scope.row)">查看</el-button>
                    <el-button
                      size="mini"
                      type="danger"
                      @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>

    </div>
</template>
<script>
// @ 是 /src 的别名
export default {
    name: 'NoticeComponent',
    props: {

    },
    data() {
        return {
            tableData5: [],
						
						categorys: []
        }
    },
		created:function(){
			this.axios.get('/client/category/listCategory')
			.then((res)=>{
				console.log(res.data)
				this.categorys = res.data
			})
		},
    methods: {
      inNotice(index,obj){
        this.$router.push("/category/detail/"+obj.categoryId)
      }
    }
}
</script>
<style scoped lang="styl">

page{
  flex-direction: column;

}
.info
  display flex
  justify-conent center
  flex-direction column

 .info .img{
  width: 80px;
  height: 80px;
 }
.query
    display flex
    justify-content flex-end
    margin 0 58px 20px 0 
.pages
    display flex
    justify-content flex-end
    margin-top 20px
</style>